package cemp.thread;

import cemp.entity.StockAll;
import cemp.entity.StockAvg;
import cemp.mapper.StockAvgMapper;

public class TestTask implements Runnable{

    private StockAvgMapper stockAvgMapper;
    private StockAll stockAll;

    public TestTask(StockAvgMapper stockAvgMapper, StockAll stockAll) {
        this.stockAvgMapper = stockAvgMapper;
        this.stockAll = stockAll;
    }

    @Override
    public void run() {
        System.out.println("run task begin");
        StockAvg avg = new StockAvg();
        avg.setStockCode(stockAll.getStockCode());
        stockAvgMapper.insert(avg);
        System.out.println("run task end");
    }
}
